inspector: Add outline for a new "recorder" tab
authorBenjamin Otte <otte@redhat.com>
Sat, 29 Oct 2016 19:11:23 +0000 (21:11 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 1 Nov 2016 17:34:40 +0000 (18:34 +0100)
gtk/inspector/Makefile.inc
gtk/inspector/init.c
gtk/inspector/recorder.c [new file with mode: 0644]
gtk/inspector/recorder.h [new file with mode: 0644]
gtk/inspector/recorder.ui [new file with mode: 0644]
gtk/inspector/window.c
gtk/inspector/window.h
gtk/inspector/window.ui

index 7641d3a9e51955909a010da077175ebc68a8e101..61adc3822c678b02da29b177749c1392302301bd 100644 (file)
@@ -19,6 +19,7 @@ inspector_c_sources =                         \
        inspector/object-tree.c         \
        inspector/prop-editor.c         \
        inspector/prop-list.c           \
+       inspector/recorder.c            \
        inspector/resource-list.c       \
        inspector/selector.c            \
        inspector/signals-list.c        \
@@ -49,6 +50,7 @@ inspector_h_sources =                         \
        inspector/object-tree.h         \
        inspector/prop-editor.h         \
        inspector/prop-list.h           \
+       inspector/recorder.h            \
        inspector/resource-list.h       \
        inspector/selector.h            \
        inspector/signals-list.h        \
@@ -71,6 +73,7 @@ inspector_templates =                 \
        inspector/object-hierarchy.ui   \
        inspector/object-tree.ui        \
        inspector/prop-list.ui          \
+       inspector/recorder.ui           \
        inspector/resource-list.ui      \
        inspector/selector.ui           \
        inspector/signals-list.ui       \
index 53a9b9e472664b5d8484d25eee12f927d110e7e1..159c1f002b16f80599b1045bb7751424c0443b42 100644 (file)
@@ -38,6 +38,7 @@
 #include "object-hierarchy.h"
 #include "object-tree.h"
 #include "prop-list.h"
+#include "recorder.h"
 #include "resource-list.h"
 #include "selector.h"
 #include "signals-list.h"
@@ -56,6 +57,8 @@ gtk_inspector_init (void)
 {
   static GIOExtensionPoint *extension_point = NULL;
 
+  g_type_ensure (G_TYPE_LIST_STORE);
+
   g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH);
   g_type_ensure (GTK_TYPE_GRAPH_DATA);
   g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
@@ -71,6 +74,7 @@ gtk_inspector_init (void)
   g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY);
   g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_TREE);
   g_type_ensure (GTK_TYPE_INSPECTOR_PROP_LIST);
+  g_type_ensure (GTK_TYPE_INSPECTOR_RECORDER);
   g_type_ensure (GTK_TYPE_INSPECTOR_RESOURCE_LIST);
   g_type_ensure (GTK_TYPE_INSPECTOR_SELECTOR);
   g_type_ensure (GTK_TYPE_INSPECTOR_SIGNALS_LIST);
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
new file mode 100644 (file)
index 0000000..c545552
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+
+#include "recorder.h"
+
+struct _GtkInspectorRecorderPrivate
+{
+  GListStore *recordings;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorRecorder, gtk_inspector_recorder, GTK_TYPE_BIN)
+
+static void
+gtk_inspector_recorder_class_init (GtkInspectorRecorderClass *klass)
+{
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+  gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/recorder.ui");
+
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorRecorder, recordings);
+}
+
+static void
+gtk_inspector_recorder_init (GtkInspectorRecorder *vis)
+{
+  gtk_widget_init_template (GTK_WIDGET (vis));
+}
+
+// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h
new file mode 100644 (file)
index 0000000..7684a7c
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GTK_INSPECTOR_RECORDER_H_
+#define _GTK_INSPECTOR_RECORDER_H_
+
+#include <gtk/gtkbin.h>
+
+#define GTK_TYPE_INSPECTOR_RECORDER            (gtk_inspector_recorder_get_type())
+#define GTK_INSPECTOR_RECORDER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorder))
+#define GTK_INSPECTOR_RECORDER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorderClass))
+#define GTK_INSPECTOR_IS_RECORDER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_RECORDER))
+#define GTK_INSPECTOR_IS_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_RECORDER))
+#define GTK_INSPECTOR_RECORDER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorderClass))
+
+
+typedef struct _GtkInspectorRecorderPrivate GtkInspectorRecorderPrivate;
+
+typedef struct _GtkInspectorRecorder
+{
+  GtkBin parent;
+} GtkInspectorRecorder;
+
+typedef struct _GtkInspectorRecorderClass
+{
+  GtkBinClass parent;
+} GtkInspectorRecorderClass;
+
+G_BEGIN_DECLS
+
+GType      gtk_inspector_recorder_get_type   (void);
+
+G_END_DECLS
+
+#endif // _GTK_INSPECTOR_RECORDER_H_
+
+// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/recorder.ui b/gtk/inspector/recorder.ui
new file mode 100644 (file)
index 0000000..ca23b23
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="gtk40">
+  <object class="GListStore" id="recordings">
+  </object>
+  <template class="GtkInspectorRecorder" parent="GtkBin">
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkPaned">
+            <property name="visible">True</property>
+            <property name="orientation">horizontal</property>
+            <child>
+              <object class="GtkListBox" id="visual_box">
+                <property name="visible">True</property>
+                <property name="selection-mode">single</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
index fcbc33fff29c86893ceb1b88a558785de589d0f8..9f84a5c52fdaa0df9d8d5e6a73a51b6986dd2f2a 100644 (file)
@@ -263,6 +263,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_node_tree);
+  gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_recorder);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_hierarchy);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_title);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, selector);
index 8aef581ede17b61b2d8e1d0399204497e9e5da30..13d066a4e62bf24af529e98337ca94edbf2680fe 100644 (file)
@@ -60,6 +60,7 @@ typedef struct
   GtkWidget *style_prop_list;
   GtkWidget *classes_list;
   GtkWidget *widget_css_node_tree;
+  GtkWidget *widget_recorder;
   GtkWidget *object_hierarchy;
   GtkWidget *size_groups;
   GtkWidget *data_list;
index 226a7074030511a407f9a8beeabe317abd8b3406..6228375de4be0fb0a4f5638c5cb93ca74f3a750c 100644 (file)
                 <property name="name">css</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkBox">
+                <property name="visible">1</property>
+              </object>
+              <packing>
+                <property name="name">recorder</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkBox">
                 <property name="visible">1</property>
             <property name="title" translatable="yes">CSS</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkInspectorRecorder" id="widget_recorder">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="name">recorder</property>
+            <property name="title" translatable="yes">Recorder</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkInspectorVisual">
             <property name="visible">True</property>